Total Complexity | 2 |
Total Lines | 11 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import prometheus from 'prom-client'; |
||
8 | export default class Timer extends Summary { |
||
9 | start(untrimmedLabels = {}) { |
||
10 | const { labelNames } = this; |
||
11 | const labels = objectOnlyKeys(untrimmedLabels, labelNames); |
||
12 | const timerStopper = this.startTimer(labels); |
||
13 | return (dirtyEndLabels = {}) => { |
||
14 | const endLabels = objectOnlyKeys(dirtyEndLabels, labelNames); |
||
15 | timerStopper(endLabels); |
||
16 | }; |
||
17 | } |
||
18 | } |
||
19 |